/*
 * 编写一个程序，求整数n的阶乘，例如5的阶乘是1*2*3*4*5
 */
package com.shangke.corejava.ch3.homework;
import java.util.Scanner;
public class Factorial {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		System.out.println("请输入一个数：");
		int a;
		int i=1,ji=1;
		a=sc.nextInt();
		while(i<=a){
			System.out.println(i);
			ji=ji*i;
			i++;
		}
		System.out.println(ji);
		sc.close();
	}
}
